home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 613 b | 39 lines | [TEXT/CWIE] |
- // Periodic.h
-
- #ifndef Periodic_h
- #define Periodic_h
-
- #ifndef Enableable_h
- #include "Enableable.h"
- #endif
- #ifndef DelayedMethod_h
- #include "DelayedMethod.h"
- #endif
-
- class Periodic: public Enableable
- {
- private:
- const Method& toRepeat;
- DelayedMethod< Periodic > repeat;
- uint32 period;
- Tick nextTime;
- bool inProgress;
-
- void Repeat();
-
- virtual void BeEnabled();
- virtual void BeDisabled();
-
- public:
- Periodic( const Method&,
- uint32 period,
- bool startEnabled = true );
-
- uint32 Period() const { return period; }
- void SetPeriod( uint32 );
-
- void Synchronize();
- };
-
- #endif
-